package com.stream;

public class ForEachOrder {
	public static void main(String[] args) {
		String str = "my name is 007";
		//使用并行流
		str.chars().parallel().forEach(i -> System.out.print((char)i));
		System.out.println();
		System.out.println("--------------");
		str.chars().forEach(i -> System.out.print((char)i));
		System.out.println();
		System.out.println("--------------");
		str.chars().parallel().forEachOrdered(i -> System.out.print((char)i));
	}
}
